package com.springcloudtest.feigntest.hello;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloFeignController {
    @Autowired
    private HelloFeignService helloFeignService;

    @GetMapping(value = "/search/github", produces = MediaType.APPLICATION_JSON_VALUE)
    public String searchGithubRepoByStr(@RequestParam("str") String queryStr){
        return helloFeignService.searchRepo(queryStr);
    }
}
